package com.zking.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
@Controller
@RequestMapping("/user")
@ResponseBody
public class LoginController {

    @GetMapping("/login")
    public String login(String name,String pwd,HttpSession session){
        session.setAttribute("username",name);
        System.out.println(name+"----"+pwd);
        //session.setMaxInactiveInterval(10*60);
        return "OK";
    }

    @GetMapping("/show")
    public String show(){
        return "Show";
    }
}
